package com.htc.dlc;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.htc.menu.MenuController;
import com.htc.menu.MenuController.MenuSelectedListener;
import com.htc.utils.CommonActions;

public class SettingsActivity extends Activity implements MenuSelectedListener,
		OnClickListener {
	MenuController menuController;
	View menuView;
	View menuViewSecondary;
	LinearLayout blurimageView;
	CommonActions ca;
	Button btn_english;
	Button btn_arabic;
	TextView tv_actionbar_title;
	public static int flag = 0;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_setting);
		this.ca = new CommonActions(this);
		initViews();
		this.menuController = new MenuController(this.menuView,
				this.menuViewSecondary, this.blurimageView, this,
				getBaseContext(), SettingsActivity.this);

	}

	private void initViews() {
		tv_actionbar_title = (TextView) findViewById(R.id.tv_actionbar_title);
		tv_actionbar_title.setText("Settings");
		this.btn_arabic = (Button) findViewById(R.id.btn_arabic);
		this.btn_english = (Button) findViewById(R.id.btn_english);
		this.btn_arabic.setOnClickListener(this);
		this.btn_english.setOnClickListener(this);
		this.menuView = findViewById(R.id.menu_container);
		this.menuViewSecondary = findViewById(R.id.menu_secondary);
		this.blurimageView = (LinearLayout) findViewById(R.id.lay_blur_image);
		checkLanguage();

	}
	public void checkLanguage(){
		if(flag == 1){
			btn_arabic.setBackgroundResource(R.drawable.btn_select);
			btn_english.setBackgroundResource(R.drawable.btn_unselect);			
		}
		else{
			btn_arabic.setBackgroundResource(R.drawable.btn_unselect);
			btn_english.setBackgroundResource(R.drawable.btn_select);			
		}
	}
	@Override
	public void onMenuSelected(int paramInt) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onClick(View v) {
		int id = v.getId();
		switch (id) {
		case R.id.btn_arabic: {
			flag = 1;
			btn_arabic.setBackgroundResource(R.drawable.btn_select);
			btn_english.setBackgroundResource(R.drawable.btn_unselect);

		}
			break;
		case R.id.btn_english: {
			flag = 0;
			btn_arabic.setBackgroundResource(R.drawable.btn_unselect);
			btn_english.setBackgroundResource(R.drawable.btn_select);
		}
			break;
		default:
			break;
		}
		// TODO Auto-generated method stub

	}
}
